package Data_Structure.DataType;

import Data_Structure.DataImplement.*;
import lombok.Data;

import java.util.Date;
import java.util.HashMap;

/**
 * The type My flight.
 *
 * @author Yibai Jiang
 * @author XiaorunWang
 * @since 30 March 2022
 * @version 1.0
 */
@Data
public class MyFlight implements Flight,SeatClassAndPrice, Baggage ,FlightStatus, MealAndPrice{

    /**
     * The number of my baggage carried on.
     */
    private int myCarryOnBaggage;

    /**
     * The number of my baggage checked in.
     */
    private int myCheckInBaggage;

    /**
     * The time of taking off.
     */
    private Date myTakeOffTime;

    /**
     * The time of landing.
     */
    private Date myLandingTime;

    /**
     * The time of boarding onto plane.
     */
    private Date myBoardingTime;

    /**
     * The source place that the passenger chose in this flight.
     */
    private String myStartPoint;


    /**
     * The destination that the passenger chose in this flight.
     */
    private String myDestPoint;


    /**
     * The flightID that the passenger chose in this flight.
     */
    private String myFlightID;


    /**
     * The gate of getting plane that the passenger chose in this flight.
     */
    private String myGate;


    /**
     * The plane type that the passenger chose in this flight.
     */
    private PlaneType myPlaneType;

    /**
     * The plane status.
     */
    private FlightStatusFs flightStatus;

    /**
     * The seat class that the passenger chose in this flight.
     */
    private String mySeatClass;


    /**
     * The seat position that the passenger chose in this flight.
     */
    private String mySeatPosition;

    /**
     * The Seat price.
     */
    private int mySeatPrice;

    /**
     * The booking number of this flight.
     */
    private String myBookingNumber;

    /**
     * The meals and the number of them.
     */
    private HashMap<Meals, Integer> meals;

    /**
     * The meals and the price of them.
     */
    private HashMap<Meals, Integer> mealPrice;

    /**
     * Change the number of baggage. Used only when initialization.
     * @param carryOnBaggage the number of carried on baggage
     * @param checkInBaggage the number of checked in baggage
     */
    @Override
    public void createBaggage(int carryOnBaggage, int checkInBaggage) {
        setMyCarryOnBaggage(carryOnBaggage);
        setMyCheckInBaggage(checkInBaggage);
    }

    /**
     * Change the start point and the end point. Used only when initialization.
     * @param startPoint the start point
     * @param destPoint  the dest point
     */
    @Override
    public void createPlaces(String startPoint, String destPoint) {
        setMyStartPoint(startPoint);
        setMyDestPoint(destPoint);
    }

    /**
     * Change the flight ID, the gate and the plane type. Used only when initialization.
     * @param flightID  the flight id
     * @param gate      the gate
     * @param planeType the plane type
     */
    @Override
    public void createFlight(String flightID, String gate, PlaneType planeType) {
        setMyFlightID(flightID);
        setMyGate(gate);
        setMyPlaneType(planeType);

    }

    /**
     * Change the time information. Used only when initialization.
     * @param takeOffTime  the taking off time
     * @param landingTime  the landing time
     * @param boardingTime the boarding time
     */
    @Override
    public void createTimes(Date takeOffTime, Date landingTime, Date boardingTime) {
        setMyTakeOffTime(takeOffTime);
        setMyLandingTime(landingTime);
        setMyBoardingTime(boardingTime);
    }

    /**
     * Change the seat information.
     * @param seatClass    the seat class
     * @param seatPosition the seat position
     * @param seatPrice    the seat price
     */
    @Override
    public void createSeatClassAndPrice(String seatClass, String seatPosition, int seatPrice) {
        setMySeatClass(seatClass);
        setMySeatPosition(seatPosition);
        setMySeatPrice(seatPrice);
    }

    /**
     * Change the meal information. Add meal to the HashMap.
     * @param meal The meal
     * @param mealPrice The price of the meal
     * @param num The number of the meal
     */
    @Override
    public void addMealAndPrice(MealAndPrice.Meals meal, int mealPrice, int num){
        meals.put(meal,num);
        this.mealPrice.put(meal,mealPrice);
    }


    /* public MyFlight(int myCarryOnBaggage,int myCheckInBaggage,Date myTakeOffTime,Date myLandingTime,Date myBoardingTime,String myStartPoint,String myDestPoint,String myFlightID,String myGate,PlaneType myPlaneType,FlightStatusFs flightStatusFs,String mySeatClass,String mySeatPosition,int mySeatPrice, String myBookingNumber,HashMap<Meals, Integer> meals,HashMap<Meals, Integer> mealPrice){
        setMyCarryOnBaggage(myCarryOnBaggage);
        setMyCheckInBaggage(myCheckInBaggage);
        setMyTakeOffTime(myTakeOffTime);
        setMyLandingTime(myLandingTime);
        setMyBoardingTime(myBoardingTime);
        setMyStartPoint(myStartPoint);
        setMyDestPoint(myDestPoint);
        setMyFlightID(myFlightID);
        setMyGate(myGate);
        setMyPlaneType(myPlaneType);
        setFlightStatus(flightStatusFs);
        setMySeatClass(mySeatClass);
        setMySeatPosition(mySeatPosition);
        setMySeatPrice(mySeatPrice);
        setMyBookingNumber(myBookingNumber);
        setMeals(meals);
        setMealPrice(mealPrice);
    } */
}
